﻿using System.Collections.Generic;
using System.Windows;

namespace Yuwell.AtomizerWeight.App.Views
{
    /// <summary>
    /// WorkModeWindow.xaml 的交互逻辑
    /// </summary>
    public partial class WorkModeWindow : Window
    {
        public WorkModeWindow()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            CoreModule.LocalConfigurationInfo info = CoreModule.LocalConfigurationInfo.Load();
            info.WorkMode = this.cbWorkMode.Text.Trim();
            info.Save();

            this.Close();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {

            List<string> strings = new List<string>
            {
                CoreModule.WorkMode.步骤一.ToString(),
                CoreModule.WorkMode.步骤二.ToString(),
                CoreModule.WorkMode.步骤一和步骤二.ToString()
            };

            this.cbWorkMode.ItemsSource = strings;

           var localConfigurationInfo= CoreModule.LocalConfigurationInfo.Load();

            this.cbWorkMode.Text = localConfigurationInfo.WorkMode;

        }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}
